<template>
  <div id="userLayout">
    <div class="container">
      <section class="user-layout-lang">
        <!-- <select-lang class="select-lang-trigger"/> -->
      </section>

      <section class="user-layout-content">
        <div class="show-image"></div>
        <div class="main">
          <img src="./img/logo_prime.png" class="prime-logo">
          <h1><span>安付</span></h1>
          <h2 v-if="!isForget">数字化受试者合规支付</h2>
          <forget v-if="isForget"></forget>
          <login-form v-else></login-form>
        </div>
      </section>

      <section class="copyright">
        <p>
          <span @click="showPrivacyVisible(true)">隐私政策</span> |
          <span @click="showClauseVisible(true)">用户协议</span>
        </p>
        <p>Copyright © 2021 杭州璞睿生命科技有限公司</p>
      </section>
    </div>

    <Clause :visible="clauseVisible" @handleCancel="showClauseVisible" />
    <Privacy :visible="privacyVisible" @handleCancel="showPrivacyVisible" />
  </div>
</template>

<script>
// import SelectLang from '@/components/SelectLang'
import LoginForm from './loginForm'
import Forget from './forget'
import Clause from '@/layouts/components/Clause'
import Privacy from '@/layouts/components/Privacy'

export default {
  name: 'UserLayout',
  components: { LoginForm, Forget, Clause, Privacy },
  data () {
    return {
      isForget: false,
      clauseVisible: false,
      privacyVisible: false
    }
  },
  methods: {
    showClauseVisible (flag = false) {
      this.clauseVisible = flag
    },
    showPrivacyVisible (flag = false) {
      this.privacyVisible = flag
    }
  }
}
</script>

<style lang="less" scoped>
#userLayout {
  height: 100%;

  .container {
    width: 100%;
    min-height: 100%;
    background: linear-gradient(90deg, #B7E0FF 0%, #E0FEFD 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;

    .user-layout-lang {
      width: 100%;
      height: 40px;
      line-height: 44px;
      text-align: right;

      .select-lang-trigger {
        cursor: pointer;
        padding: 12px;
        margin-right: 24px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        vertical-align: middle;
      }
    }

    .user-layout-content {
      width: 960px;
      height: 540px;
      display: flex;
      box-shadow: 0 40px 70px -20px rgba(0, 88, 200, 0.2);

      .show-image {
        width: 480px;
        height: 100%;
        background: url("./img/login.png") no-repeat;
        background-size: 100% 100%;
      }

      .main {
        flex: 1;
        background: #fff;
        padding: 40px 80px;

        .prime-logo {
          width: 128px;
          margin-bottom: 20px;
        }

        h1 {
          margin-bottom: 0;

          span {
            font-family: Saira;
            font-size: 40px;
            font-weight: bold;
          }

          em {
            font-size: 23px;
            font-weight: bold;
            color: #1CC2FD;
            font-style: normal;
          }
        }

        h2 {
          font-size: 30px;
          font-weight: bold;
          color: #0F121B;
          margin-bottom: 30px;
        }
      }
    }

    .copyright {
      font-size: 11px;
      font-weight: 400;
      line-height: 18px;
      color: #007FDF;
      opacity: 1;
      padding-bottom: 20px;
      text-align: center;
      span {
        cursor: pointer;
      }
    }
  }
}
</style>
